package mr.ali.video.web.controller;


import mr.ali.video.web.Exception.R;
import mr.ali.video.web.model.Prizes;
import mr.ali.video.web.service.IPrizesService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author Mr-ali
 * @since 2025-09-08
 */
@RestController
@RequestMapping("/web/prizes")
public class PrizesController {
    @Resource
    private IPrizesService prizesService;

    @GetMapping("/all")
    public List<Prizes> getPrizes(){
        return prizesService.getPrizes();
    }

    @GetMapping("/update")
    public R<Prizes> updatePrizes(Prizes prizes){
        return R.ok(prizesService.updatePrizes(prizes));
    }
}
